<include file='Common:header' />

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">

    <!-- #section:basics/sidebar -->

    <include file='Common:left' />
    <!-- /section:basics/sidebar -->
    <div class="main-content">
        <div class="main-content-inner">
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div>
                            <div class="col-xs-12 col-sm-2">
                                <a href="__URL__/crops_add">
                                    <button class="btn btn-xs btn-info">添加农作物</button>
                                </a>
                            </div>
                            <form id="leftnav" name="leftnav" method="post" action="" >
                                <input type="hidden" name="checkk" id="checkk" value="1" /><!--用于判断操作类型-->
                                <table id="dynamic-table" class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th width='5%'></th>
                                            <th width="8%">名称</th>
                                            <th width="8%">发芽</th>
                                            <th width="8%">生长</th>
                                            <th width="8%">成熟</th>
                                            <th width="8%">生长期</th>
                                            <th width="8%">发芽期</th>
                                            <th width="8%">成熟期</th>
                                            <th width="8%">状态</th>
                                            <th width="22%" style="border-right:#CCC solid 1px;">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <foreach name="crops" item="v">
                                        <tr>
                                            <td>{$v.id}</td>
                                            <td>{$v.crops_name}</td>
                                            <td> <img src="{:UPLOAD_PATH}{$v.crops_sprout_img}" width="50"></td>
                                            <td> <img src="{:UPLOAD_PATH}{$v.crops_grow_img}" width="50"></td>
                                            <td> <img src="{:UPLOAD_PATH}{$v.crops_ripe_img}" width="50"></td>
                                            <td>{$v.crops_seed}</td>
                                            <td>{$v.crops_sprout}</td>
                                            <td>{$v.crops_maturity}</td>
                                            <td><if condition="$v['display'] eq 1">开启<else/><span class="red">禁用</span></if></td>
                                        <td>
                                            <div class="hidden-sm hidden-xs action-buttons">
                                                <a class="green" href="{:U('crops_edit',array('id'=>$v['id']))}" title="修改">
                                                    <i class="ace-icon fa fa-pencil bigger-130"></i>
                                                </a>
                                                <a class="red" href="javascript:;" onclick="return del({$v.id});" title="删除">
                                                    <i class="ace-icon fa fa-trash-o bigger-130"></i>									
                                                </a>
                                            </div>
                                        </td>
                                        </tr>
                                    </foreach>   
                                    <tr>
                                        <td colspan="11" align="right">{$page}</td>
                                    </tr>
                                    </tbody>
                                </table>
                            </form>
                        </div>
                    </div>
                </div>

                <include file='Common:header_nav' />

            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->


    <script>
        function del(id) {
            layer.confirm('你确定要删除吗？', {icon: 3}, function (index) {
                layer.close(index);
                window.location.href = "__URL__/crops_del/del_id/" + id + "";
            });
        }
    </script>
    <include file='Common:footer' />

</div><!-- /.main-container -->
</body>
</html>
